package com.online.questionnaire;

/**
 * 试卷类型
 */
public enum QuestionType {

    // 问题类型：0 单选 1多选 2单行填空 3多行填空
    SINGLE_CHOICE(0,"单选"),
    MULTIPLE_CHOICE(1,"多选"),
    SINGLE_LINE_FILL_IN(2,"单行填空"),
    MULTIPLE_LINE_FILL_IN(3,"多行填空"),
    RATE(4,"评分"),
    TIME_PICKER(5,"时间选择");
    private int code;
    private String name;

    private QuestionType(int code,String desc){
        this.code = code;
        this.name = desc;
    }
    public int getCode() {
        return code;
    }
    public String getName() {
        return name;
    }

    public static String getQuestionTypeText(int type)
    {
        for(QuestionType questionType : QuestionType.values())
        {
            if(questionType.getCode() == type)
            {
                return questionType.getName();
            }
        }
        return "未知";
    }


}
